/* GUI CONVERTED from rwwciq.p (converter v1.75) Sat Aug 12 23:18:24 2000 */
/* rwwciq.p - WORKCENTER INQUIRY                                              */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* web convert rwwciq.p (converter v1.00) Fri Oct 10 13:58:01 1997 */
/* web tag in rwwciq.p (converter v1.00) Mon Oct 06 14:18:41 1997 */
/*F0PN*/ /*K1J9*/ /*                                                    */
/*V8:ConvertMode=Report                                              */
/* REVISION: 1.0      LAST MODIFIED: 04/08/86   BY: PML       */
/* REVISION: 1.0      LAST MODIFIED: 01/17/86   BY: EMB       */
/* REVISION: 4.0      LAST MODIFIED: 12/30/87   BY: WUG *A137**/
/* REVISION: 4.0      LAST MODIFIED: 02/17/88   BY: RL  *A171**/
/* REVISION: 5.0      LAST MODIFIED: 05/03/89   BY: WUG *B098**/
/* REVISION: 6.0      LAST MODIFIED: 05/04/90   BY: RAM *D018**/
/* REVISION: 6.0      LAST MODIFIED: 11/02/90   BY: emb *D175**/
/* Revision: 7.3    Last edit: 11/19/92     By: jcd *G339* */
/* REVISION: 7.3      LAST MODIFIED: 02/24/93   BY: sas *G729*/
/* REVISION: 7.3      LAST MODIFIED: 08/28/94   BY: srk *GL73*/
/* REVISION: 8.5      LAST MODIFIED: 07/30/96   BY: *J12T* Sue Poland         */
/* REVISION: 8.6      LAST MODIFIED: 02/24/98   BY: *K1J9* Beena Mol          */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb                  */

/* Note: Changes made here may be desireable in fswciq.p */

          /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

          {mfdtitle.i "b+ "} /*G729*/

          define variable wkctr like wc_wkctr.
          define variable mch like wc_mch.
          define variable desc1 like wc_desc.
          define variable dept like wc_dept.

          
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
/*GL73*/     
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
space(1)
             wkctr
             mch
             dept           skip
/*GL73*/     space(1)
             desc1          no-label no-attr-space
          with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



          /* SET EXTERNAL LABELS */
          setFrameLabels(frame a:handle).

/*K1J9*/ {wbrp01.i}

         repeat:

/*K1J9*/    if c-application-mode <> 'web' then
              update wkctr mch dept with frame a editing:

                if frame-field = "wkctr" then do:
               /* FIND NEXT/PREVIOUS RECORD - NON-SERVICE W/C'S ONLY */
/*J12T*             {mfnp.i wc_mstr wkctr wc_wkctr mch wc_mch wc_wkctr}    */
/*J12T*/            {mfnp05.i wc_mstr wc_fsm_type "wc_fsm_type = "" "" "
                     wc_wkctr "input wkctr"}

               if recno <> ? then do:
                   display wc_wkctr @ wkctr
                       wc_mch @ mch
                       wc_desc @ desc1 with frame a.
               end.
               recno = ?.
                end.
                else if frame-field = "mch" then do:
               /* FIND NEXT/PREVIOUS RECORD */
               {mfnp01.i wc_mstr mch wc_mch "input wkctr" wc_wkctr wc_wkctr}

               if recno <> ? then do:
                   display
                       wc_mch @ mch
                       wc_desc @ desc1 with frame a.
               end.
                end.
                else do:
               status input.
               readkey.
               apply lastkey.
                end.
            end.     /* editing */
            status input.

/*K1J9*/ {wbrp06.i &command = update &fields = "  wkctr mch dept" &frm = "a"}

/*K1J9*/ if (c-application-mode <> 'web') or
/*K1J9*/ (c-application-mode = 'web' and
/*K1J9*/ (c-web-request begins 'data')) then do:
            desc1 = "".
            find wc_mstr where wc_wkctr = wkctr
                and wc_mch = mch
                no-lock no-error.
            if available wc_mstr then /*G729*/ do:
/*J12T*         {fswcv.i &fld=wc_wkctr &type=2}     */
/*J12T*/        if wc_fsm_type = "FSM" then do:
/*J12T*/            {mfmsg.i 7485 3}    /* THIS IS AN SSM WORK CENTER... */
/*K1J9*/            if c-application-mode = 'web' then return.
/*J12T*/            undo, retry.
/*J12T*/        end.
                display wc_desc @ desc1 with frame a.
/*G729*/    end.
            else display desc1 with frame a.

            hide frame b.

/*K1J9*/ end.

            /* SELECT PRINTER */
            {mfselprt.i "terminal" 80}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


            for each wc_mstr where wc_wkctr >= wkctr
                and wc_mch >= mch
                and (wc_dept = dept or dept = "" )
                no-lock with frame b width 80 no-attr-space:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame b:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

/*J12T*         FSM WORK CENTER DESIGNATION HAS BEEN MOVED OUT OF QAD_WKFL...
./*G729*/        if can-find(qad_wkfl where qad_key1 = "wc_fsm" and
./*G729*/            qad_key2 = wc_wkctr) then next.
.*J12T*/
/*J12T*/        if wc_fsm_type = "FSM" then next.   /* SKIP FSM WORK CTRS */

                display wc_wkctr wc_mch wc_desc wc_dept
/*D018                  wc_lbr_cap wc_mch_op wc_queue. */
/*D018*/                wc_mch_op wc_queue wc_wait WITH STREAM-IO /*GUI*/ .

            end.    /* for each wc_mstr */

            {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

            {mfmsg.i 8 1}

         end.   /* repeat */

/*K1J9*/ {wbrp04.i &frame-spec = a}
